/// 举报对象
class ReportObj {
  ReportObj({
    this.remark = '',
    this.reportType = '',
    this.targetId = '',
    this.targetType = '',
  });

  late String remark;
  late String reportType;
  late String targetId;
  late String targetType;

  String get check {
    if (reportType.isEmpty) return '请选择举报类型';
    if (targetId.isEmpty) return '未知id';
    if (targetType.isEmpty) return '未知类型';

    if (reportType == 'OTHER') {
      if (remark.isEmpty) return '请填写描述';
    }

    return 'success';
  }

  Map<String, dynamic> toJson() {
    return <String, dynamic>{
      if (reportType == 'OTHER') 'remark': remark,
      'reportType': reportType,
      'targetId': targetId,
      'targetType': targetType,
    };
  }
}
